home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 830 b | 41 lines | [TEXT/R*ch] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 9, example 6
-
- module XYZ
- uses ScriptX
- exports x, y, z
- end
- in module XYZ
- global x:10, y:"foo", z:#(56,567)
-
- -- Import all from XYX and prefix the variables with XYZ_
- module XYZprefix1
- uses ScriptX
- uses XYZ with
- prefix XYZ_
- end
- end
- in module XYZprefix1
- -- trying to print x in this module should generate an exception
- print x
- print XYZ_x
- print XYZ_y
-
- -- Now do both a prefix and a rename. The rename overrides
- -- the prefix for those specific variables.
- module XYZprefix2
- uses ScriptX
- uses XYZ with
- prefix ext_
- renames x:fumbleWhizzy
- end
- end
- in module XYZprefix2
- -- trying to print ext_x in this module should generate an exception
- -- since we overrode the definition of ext_x by renaming it
- print ext_x
- print ext_y
- print fumbleWhizzy
- -->>>